package com.niit.chat.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.niit.chat.entity.Session;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 会话Mapper接口
 */
@Mapper
public interface SessionMapper extends BaseMapper<Session> {

    /**
     * 根据会话ID获取会话名称
     *
     * @param sessionId 会话ID
     * @return 会话名称
     */
    @Select("SELECT name FROM tb_chat_session WHERE id = #{sessionId}")
    String getSessionNameById(Long sessionId);
}
